<template>
  <div class="app-container">
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-search"
          size="mini"
          @click="handleSearch"
          >搜索</el-button
        >
      </el-col>

      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-circle-check"
          size="mini"
          :disabled="pickingList.length <= 0"
          @click="show(1)"
          v-hasPermi="['output:pickingCheck:check']"
        >
          批准
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          :disabled="pickingList.length <= 0"
          icon="el-icon-circle-close"
          size="mini"
          @click="show(2)"
          v-hasPermi="['output:pickingCheck:rollback']"
        >
          撤回
        </el-button>
      </el-col>

      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          :loading="exportLoading"
          @click="handleDc('#exportPzDj', '生产领料单据')"
          v-hasPermi="['output:picking:export']"
        >
          EXCEL
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          :loading="exportLoading"
          @click="handleDc('#exportPzMx', '生产领料明细')"
          v-hasPermi="['output:picking:export']"
        >
          领料明细
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          :loading="exportLoading"
          @click="handleDc('#exportPzTj', '生产领料统计')"
          v-hasPermi="['output:picking:export']"
        >
          领料统计
        </el-button>
      </el-col>
      <Tag type="dot" size="default" color="#0fac09">提交</Tag>
      <Tag type="dot" size="default" color="#bb0331">通过</Tag>
      <Tag type="dot" size="default" color="#0323af">检验</Tag>
      <right-toolbar
        :showSearch.sync="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row>

    <el-table
      @scrollBottom="load"
      highlight-current-row
      border
      stripe
      v-loading="loading"
      :data="pickingList"
      :height="tableH"
      id="exportPzDj"
      @row-click="clickRow"
      :cell-style="iCellStyle"
      :header-cell-style="{ 'text-align': 'center' }"
    >
      <el-table-column label="#" width="40" align="center" />
      <el-table-column
        label="领料单号"
        :show-overflow-tooltip="true"
        width="100"
        align="center"
        prop="clmDjbh"
      />
      <el-table-column
        label="领料日期"
        :show-overflow-tooltip="true"
        align="center"
        prop="clmLlrq"
        width="180"
      >
        <template #default="scope">
          <span>{{
            parseTime(scope.row.clmLlrq, "{y}-{m}-{d} {h}:{i}:{s}")
          }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="单据类型"
        :show-overflow-tooltip="true"
        width="100"
        align="center"
        prop="clmType"
      >
        <template #default="scope">
          <dict-tag :options="clmTypeOptions" :value="scope.row.clmType" />
        </template>
      </el-table-column>
      <el-table-column
        label="仓库代码"
        :show-overflow-tooltip="true"
        width="100"
        align="center"
        prop="clmCkdm"
      >
        <template #default="scope">
          <dict-tag :options="allStorageOptions" :value="scope.row.clmCkdm" />
        </template>
      </el-table-column>
      <el-table-column
        label="领料部门"
        :show-overflow-tooltip="true"
        width="100"
        align="center"
        prop="clmBmdm"
      />
      <el-table-column
        label="单据描述"
        :show-overflow-tooltip="true"
        width="100"
        align="center"
        prop="clmDesc"
      />
      <el-table-column
        label="建立人员"
        :show-overflow-tooltip="true"
        width="100"
        align="center"
        prop="clmJlry"
      />
      <el-table-column
        label="建立日期"
        :show-overflow-tooltip="true"
        align="center"
        prop="clmJlrq"
        width="180"
      >
        <template #default="scope">
          <span>{{
            parseTime(scope.row.clmJlrq, "{y}-{m}-{d} {h}:{i}:{s}")
          }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="审核人员"
        :show-overflow-tooltip="true"
        width="100"
        align="center"
        prop="clmShry"
      />
      <el-table-column
        label="审核日期"
        :show-overflow-tooltip="true"
        align="center"
        prop="clmShrq"
        width="180"
      >
        <template #default="scope">
          <span>{{
            parseTime(scope.row.clmShrq, "{y}-{m}-{d} {h}:{i}:{s}")
          }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="过账人员"
        :show-overflow-tooltip="true"
        width="100"
        align="center"
        prop="clmGzry"
      />
      <el-table-column
        label="过账日期"
        :show-overflow-tooltip="true"
        align="center"
        prop="clmGzrq"
        width="180"
      >
        <template #default="scope">
          <span>{{
            parseTime(scope.row.clmGzrq, "{y}-{m}-{d} {h}:{i}:{s}")
          }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="原因代码"
        :show-overflow-tooltip="true"
        width="100"
        align="center"
        prop="clmYydm"
      >
        <template #default="scope">
          <dict-tag :options="clmYydmOptions" :value="scope.row.clmYydm" />
        </template>
      </el-table-column>
      <el-table-column
        label="原因描述"
        :show-overflow-tooltip="true"
        width="100"
        align="center"
        prop="clmYyms"
      />
    </el-table>
    <!--明细-->
    <el-tabs v-model="activeTab">
      <el-tab-pane label="领料明细" name="first">
        <el-table
          border
          stripe
          id="exportGzMx"
          :height="tableHAddChild"
          :data="chdDetList"
          :header-cell-style="{ 'text-align': 'center' }"
        >
          <el-table-column
            label="#"
            type="index"
            min-width="5"
            align="center"
            fixed="left"
          />
          <el-table-column
            label="客户编码"
            align="center"
            min-width="20"
            prop="itmCustWldm"
            fixed="left"
          />
          <el-table-column
            label="制造单号"
            align="center"
            min-width="20"
            prop="cldZzdh"
            fixed="left"
          />
          <el-table-column
            label="领料物料代码"
            align="center"
            min-width="20"
            prop="cldWldm"
          />
          <el-table-column
            label="客户物料编码"
            align="center"
            min-width="20"
            prop="itmCustWldm"
          />
          <el-table-column
            label="规格描述"
            show-overflow-tooltip
            min-width="50"
            prop="itmPmgg"
          />
          <el-table-column
            label="申请数量"
            align="center"
            min-width="10"
            prop="cldSqsl"
          />
          <el-table-column
            label="单位"
            :show-overflow-tooltip="true"
            min-width="10"
            align="center"
            prop="itmDw"
          >
            <template #default="scope">
              <dict-tag :options="unitFlagOptions" :value="scope.row.itmDw" />
            </template>
          </el-table-column>
          <el-table-column
            label="存放位置"
            :show-overflow-tooltip="true"
            min-width="15"
            align="center"
            prop="cldCwdm"
          >
            <template #default="scope">
              <dict-tag :options="allCwOptions" :value="scope.row.cldCwdm" />
            </template>
          </el-table-column>
          <el-table-column
            label="出库数量"
            align="center"
            min-width="10"
            prop="cldCksl"
          />
          <el-table-column
            label="出库人员"
            align="center"
            min-width="10"
            prop="cldCkry"
          />
          <el-table-column
            label="出库日期"
            :show-overflow-tooltip="true"
            align="center"
            prop="cldCkrq"
            min-width="24"
          >
            <template #default="scope">
              <span>{{
                parseTime(scope.row.cldCkrq, "{y}-{m}-{d} {h}:{i}:{s}")
              }}</span>
            </template>
          </el-table-column>
          <el-table-column
            label="最小包装"
            align="center"
            min-width="10"
            prop="cldMinbz"
          />
        </el-table>
      </el-tab-pane>
      <el-tab-pane label="领料统计" name="second">
        <el-table
          border
          stripe
          id="exportGzTj"
          :height="tableHAddChild"
          :data="chdDetTotalList"
        >
          <el-table-column label="#" type="index" align="center" fixed="left" />
          <el-table-column
            label="客户编码"
            align="center"
            prop="itmCustWldm"
            fixed="left"
          />
          <el-table-column
            label="物料代码"
            align="center"
            prop="cldWldm"
            fixed="left"
          />
          <el-table-column label="规格描述" align="center" prop="itmPmgg" />
          <el-table-column
            label="单位"
            :show-overflow-tooltip="true"
            align="center"
            prop="itmDw"
          >
            <template #default="scope">
              <dict-tag :options="unitFlagOptions" :value="scope.row.itmDw" />
            </template>
          </el-table-column>
          <el-table-column
            label="存放位置"
            :show-overflow-tooltip="true"
            align="center"
            prop="cldCwdm"
          >
            <template #default="scope">
              <dict-tag :options="allCwOptions" :value="scope.row.cldCwdm" />
            </template>
          </el-table-column>
          <el-table-column label="最小包装" align="center" prop="cldCksl" />
          <el-table-column label="申请数量" align="center" prop="cldSqsl" />
          <el-table-column label="出库数量" align="center" prop="cldCksl" />
          <el-table-column
            label="操作"
            align="center"
            width="120"
            fixed="right"
            class-name="small-padding fixed-width"
          >
            <template #default="scope">
              <el-button
                size="mini"
                type="text"
                @click="handleCkqr(scope.row)"
                v-hasPermi="['output:picking:addCld']"
                >出库确认</el-button
              >
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>
    </el-tabs>
    <!-- 查询对话框   -->
    <el-dialog
      :title="title"
      v-model="openSearch"
      :close-on-click-modal="false"
      draggable
      width="450px"
      append-to-body
    >
      <el-form
        :model="queryParams"
        ref="queryForm"
        :inline="true"
        v-show="showSearch"
        label-width="88px"
      >
        <el-col :span="24">
          <el-form-item label="领料单号" prop="clmDjbh">
            <el-input
              v-model="queryParams.clmDjbh"
              placeholder="请输入单据编号"
              clearable
              style="width: 240px"
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="领料日期">
            <el-date-picker
              v-model="daterangeClmLlrq"
              size="small"
              style="width: 240px"
              value-format="yyyy-MM-dd HH:mm:ss"
              type="daterange"
              :clearable="false"
              range-separator="-"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              :picker-options="pickerOptions"
              :default-time="['00:00:00', '23:59:59']"
            ></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="仓库" prop="clmCkdm">
            <el-select v-model="queryParams.clmCkdm" placeholder="请选择仓库">
              <el-option
                v-for="item in storageOptions"
                :key="item.dictValue"
                :label="item.dictLabel"
                :value="item.dictValue"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="品名规格" prop="clmPmgg">
            <el-input
              v-model="queryParams.clmPmgg"
              clearable
              style="width: 240px"
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="状态标志">
            <el-radio-group v-model="queryParams.clmZtbz">
              <el-radio
                v-for="dict in cjmZtbzOptions"
                :key="dict.dictValue"
                :label="dict.dictValue"
                >{{ dict.dictLabel }}</el-radio
              >
            </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item
            style="margin-top: 25px; display: flex; justify-content: flex-end"
          >
            <el-button @click="cancel">取消</el-button>
            <el-button type="primary" @click="handleQuery">确认</el-button>
          </el-form-item>
        </el-col>
      </el-form>
    </el-dialog>
    <!-- 撤回 -->
    <Modal v-model="check_back" draggable scrollable width="300">
      <p slot="header" style="color: #f60; text-align: center">
        <Icon type="ios-information-circle"></Icon>
        <span>确认撤回重写？</span>
      </p>
      <div style="text-align: center">
        <p>撤回理由</p>
        <Input v-model="back_reason" style="width: 75%" />
      </div>
      <div slot="footer">
        <Button type="error" size="large" long @click="handleBack">撤回</Button>
      </div>
    </Modal>
    <!-- 审核 -->
    <Modal v-model="check_check" draggable scrollable width="300">
      <p slot="header" style="color: #f60; text-align: center">
        <Icon type="ios-information-circle"></Icon>
        <span>确认</span>
      </p>
      <div style="text-align: center">
        <p>确认将【入库单号：{{ djbh }}】的材料进行审核作业吗？</p>
        <p>一旦操作无法更改，材料将进入仓库过账作业，请谨慎操作。</p>
      </div>
      <div slot="footer">
        <Button type="success" size="large" long @click="handleCheck"
          >审核</Button
        >
      </div>
    </Modal>
  </div>
</template>

<script>
import {
  listPicking,
  getPicking,
  delPicking,
  addPicking,
  updatePicking,
  exportPicking,
  searchCk,
  ckSumitChild,
  listckMxDet,
  clmMstrCheck,
  clmMstrBack,
} from "@/api/output/picking";
import { getAll, getstorageType } from "@/api/repertory/Storage";
import { getAllCgList } from "@/api/project/mstr";
import { chmMstrBack } from "@/api/output/proShipped";
import { exportTable } from "@/utils/ruoyi";

export default {
  name: "pickingCheck",
  data() {
    return {
      // 遮罩层
      loading: true,
      openFull: false,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 显示搜索条件
      showSearch: true,
      openSearch: false,
      // 总条数
      total: 0,
      // 出库领料开单作业表格数据
      pickingList: [],
      cjmZtbzOptions: [],
      chdDetList: [],
      chdDetTotalList: [],
      serachAddList: [],
      tableH: 250,
      tableHChild: 300,
      tableHAdd: 250,
      tableHAddChild: 300,
      activeTab: "first",
      //所有仓库
      allStorageOptions: [],
      //有效仓库
      storageOptions: [],
      rowdata: [],
      djbh: null,
      //当前数据
      rowData: null,
      back_reason: null,
      //选择标识
      type1: true,
      //原因描述flag
      reasonDescriptionFlag: true,
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      check_check: false,
      check_back: false,
      // 单据类型字典
      clmTypeOptions: [],
      // 原因代码字典
      clmYydmOptions: [],
      itCarOptions: [],
      // 领料日期时间范围
      daterangeClmLlrq: [
        this.$moment().startOf("month").toDate(),
        this.$moment().add(100, "year").endOf("month").toDate(),
      ],
      unitFlagOptions: [],
      bomCgsxOptions: [],
      //日期初始化
      pickerOptions: {
        shortcuts: [
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      },

      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 25,
        clmDjbh: null,
        clmLlrq: null,
        clmCkdm: null,
        clmPmgg: null,
        clmZtbz: "1",
        clmTjflag: "1",
      },
      // 添加物料-查询参数
      queryChildParams: {
        pageNum: 1,
        pageSize: 20,
        clmZzdh: null,
        clmCj: "所有",
        integratedQuery: null,
        clmDjbh: null,
        clmCkdm: null,
        clmType: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        clmType: [
          { required: true, message: "单据类型不能为空", trigger: "change" },
        ],
        clmCkdm: [
          { required: true, message: "仓库代码不能为空", trigger: "blur" },
        ],
      },
    };
  },
  created() {
    this.getList();
    //制造车间字典
    //单位
    this.getAllDicts("sys_unit").then((response) => {
      this.unitFlagOptions = response.data;
    });
    //得到采购属性
    getAllCgList().then((response) => {
      this.bomCgsxOptions = response.data;
      for (let i of this.bomCgsxOptions) {
        i.dictLabel = i.cgName;
        i.dictValue = i.cgId + "";
        i.listClass = "default";
      }
    });
    this.getDicts("Manufacturing_plant").then((response) => {
      this.itCarOptions = response.data;
    });
    this.getDicts("production_pick_type").then((response) => {
      this.clmTypeOptions = response.data;
    });
    this.getDicts("reason_category").then((response) => {
      this.clmYydmOptions = response.data;
    });
    this.getDicts("sys_cjm_ztbz").then((response) => {
      this.cjmZtbzOptions = response.data;
    });
    //所有仓库
    getAll().then((response) => {
      this.allStorageOptions = response.data;

      for (let item of this.allStorageOptions) {
        item.dictLabel = item.storageName;
        item.listClass = "default";
        item.dictValue = item.storageId + "";
      }
    });
    //有效仓库
    getstorageType("0").then((response) => {
      this.storageOptions = response.data;

      for (let item of this.storageOptions) {
        item.dictLabel = item.storageName;
        item.listClass = "default";
        item.dictValue = item.storageId + "";
      }
    });
  },
  methods: {
    /** 查询出库领料开单作业列表 */
    getList(row) {
      this.loading = true;
      this.queryParams.params = {};
      if (null != this.daterangeClmLlrq && "" != this.daterangeClmLlrq) {
        this.queryParams.params["beginClmLlrq"] = this.moment(
          this.daterangeClmLlrq[0]
        ).format("YYYY-MM-DD HH:mm:ss");
        this.queryParams.params["endClmLlrq"] = this.moment(
          this.daterangeClmLlrq[1]
        ).format("YYYY-MM-DD HH:mm:ss");
      }
      this.queryParams.pageNum = 1;
      listPicking(this.queryParams).then((response) => {
        this.pickingList = [];
        this.chdDetList = [];
        this.chdDetTotalList = [];
        this.pickingList = this.pickingList.concat(response.rows);
        this.total = response.total;
        this.loading = false;
        if (row != null) {
          this.clickRow(row);
        } else if (this.pickingList != null && this.pickingList.length > 0) {
          this.clickRow(this.pickingList[0]);
        }
      });
    },

    //load
    load() {
      if (
        this.queryParams.pageNum <
        Math.ceil(this.total / this.queryParams.pageSize)
      ) {
        this.queryParams.pageSize = 25;
        this.queryParams.pageNum++;
        listPicking(this.queryParams).then((response) => {
          this.pickingList = this.pickingList.concat(response.rows);
          this.total = response.total;
          this.loading = false;
        });
      }
      return 0;
    },

    getChdDetList(chdDjbh) {
      listckMxDet(chdDjbh).then((response) => {
        this.chdDetTotalList = response.data.list2;
        this.chdDetList = response.data.list1;
      });
    },
    iCellStyle: function ({ row, column, rowIndex, columnIndex }) {
      //提交
      if (row.clmZtbz == "1" && row.clmTjflag == "1") {
        return "color:#0fac09";
      }
      //通过
      else if (row.clmZtbz == "2" && row.clmTjflag == "1") {
        return "color:#0323af";
      }
      //检验
      else if (row.clmZtbz == "6" && row.clmTjflag == "1") {
        return "color:#bb0331";
      }
    },
    clickRow(row) {
      // //获得选中的详细数据
      this.rowData = row;
      this.djbh = row.clmDjbh;
      // //获得当前单据的状态
      // this.ids = row.rwmId
      this.type1 = !(row != null && row.clmZtbz == "1" && row.clmTjflag == "1");
      //获得选中的详细数据
      this.getChdDetList(row.clmDjbh);
    },
    // getCldDetList(data) {
    //
    // },
    // 取消按钮
    cancel() {
      this.open = false;
      this.openSearch = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        clmId: null,
        clmDjbh: null,
        clmType: null,
        clmCkdm: null,
        clmBmdm: null,
        clmDesc: null,
        clmTjflag: null,
        clmNgdesc: null,
        clmZtbz: null,
        clmJlry: null,
        clmJlrq: null,
        clmShry: null,
        clmShrq: null,
        clmGzry: null,
        clmGzrq: null,
        clmYydm: null,
        clmYyms: null,
        clmLlrq: new Date(),
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.pickingList = [];
      this.getList();
      this.openSearch = false;
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.daterangeClmLlrq = [];
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.clmId);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加出库领料开单作业";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const clmId = row.clmId || this.rowData.clmId;
      getPicking(clmId).then((response) => {
        this.form = response.data;
        this.open = true;
        this.title = "修改出库领料开单作业";
      });
    },
    /** 审核、撤回操作 */
    show(e) {
      if (this.rowData.clmZtbz != 1 || this.rowData.clmTjflag != 1) {
        this.$Modal.warning({
          title: "提示",
          content: "该单据已审核，不允许此操作",
        });
      } else {
        if (e == 1) {
          this.check_check = true;
        } else {
          this.check_back = true;
        }
      }
    },
    /** 审核 */
    handleCheck() {
      clmMstrCheck(this.rowData.clmDjbh)
        .then((res) => {
          this.msgSuccess("审核单据成功~");
          this.check_check = false;
          this.getList();
        })
        .catch(() => {
          this.msgError("审核单据失败~");
        });
    },
    /** 撤回 */
    handleBack() {
      clmMstrBack(this.rowData.clmDjbh, this.back_reason)
        .then((res) => {
          this.msgSuccess("撤回成功~");
          this.check_back = false;
          this.getList();
        })
        .catch(() => {
          this.msgError("撤回失败~");
        });
    },
    handleSearch() {
      this.reset();
      this.title = "查询出库领料开单作业";
      this.openSearch = true;
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          this.form.clmBmdm = this.$store.state.user.deptName;
          if (this.form.clmId != null) {
            updatePicking(this.form).then((response) => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addPicking(this.form).then((response) => {
              this.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const clmIds = row.clmId || this.rowData.clmId;
      this.$confirm(
        '是否确认删除出库领料开单作业编号为"' + clmIds + '"的数据项?',
        "警告",
        {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        }
      )
        .then(function () {
          return delPicking(clmIds);
        })
        .then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
    handleDc(a, b) {
      exportTable(a, b);
    },
    //改变原因描述状态
    changeDescriptionFlag(data) {
      if (data) {
        this.reasonDescriptionFlag = false;
      } else {
        this.reasonDescriptionFlag = true;
      }
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm("是否确认导出所有出库领料开单作业数据项?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.exportLoading = true;
          return exportPicking(queryParams);
        })
        .then((response) => {
          this.download(response.msg);
          this.exportLoading = false;
        })
        .catch(() => {});
    },
  },
};
</script>

<!--<style scoped>-->
<!--</style>-->
